//----------------------------------------------------------------------------------------------
//	Meson::Cuneus::IGarbageCollector
//	This is the Garbage Collection interface.
//----------------------------------------------------------------------------------------------
//	Author			Date		Version		Description
//----------------------------------------------------------------------------------------------
//	Gordon Mangion 	27/09/2007	1.0.0		Initial version.
//----------------------------------------------------------------------------------------------
#pragma once

#include <Configuration.h>

#include "CnsNamespaces.h"
#include "CnsMemoryHandle.h"

Meson_Cuneus_BEGIN

class IGarbageCollector
{

public:
	virtual void Startup( Meson::Common::Config::Configuration &p_config ) = 0;
	virtual void Shutdown( void ) = 0;

	//----------------------------------------------------------------------------------------------
	// Allocates a block of memory
	//----------------------------------------------------------------------------------------------
	virtual MemoryHandle Alloc( dword p_dwSize ) = 0;

	//----------------------------------------------------------------------------------------------
	// Frees an allocated block of memory
	//----------------------------------------------------------------------------------------------
	virtual void Free( MemoryHandle &p_handle ) = 0;
	
	//----------------------------------------------------------------------------------------------
	// Re-allocates a block of memory
	//----------------------------------------------------------------------------------------------
	virtual void Realloc( MemoryHandle &p_handle, dword p_dwSize ) = 0;

	//----------------------------------------------------------------------------------------------
	// Clears a block of memory
	//----------------------------------------------------------------------------------------------
	virtual void Clear( MemoryHandle &p_handle ) = 0;

	//----------------------------------------------------------------------------------------------
	// Copies a block of memory
	//----------------------------------------------------------------------------------------------
	virtual MemoryHandle Copy( MemoryHandle &p_handle ) = 0;

	//----------------------------------------------------------------------------------------------
	// Compares two blocks of memory
	//----------------------------------------------------------------------------------------------
	virtual int Compare( MemoryHandle &p_handle1, MemoryHandle &p_handle2 ) = 0; 

	//----------------------------------------------------------------------------------------------
	// Fills a block of memory
	//----------------------------------------------------------------------------------------------
	virtual void Fill( MemoryHandle &p_handle, byte p_byValue ) = 0;

	//----------------------------------------------------------------------------------------------
	// Perform Garbage Collection
	//----------------------------------------------------------------------------------------------
	virtual void Collect( void ) = 0;
	virtual void Collect( dword p_dwTimespan ) = 0;

};

Meson_Cuneus_END
